//
//  SetPassWordTableViewCell.m
//  ChengHuiTong
//
//  Created by ypwl on 15/11/30.
//  Copyright © 2015年 张文权. All rights reserved.
//

#import "SetPassWordTableViewCell.h"

@implementation SetPassWordTableViewCell{
    
    
    
    
}



-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        if ([reuseIdentifier isEqualToString:@"cell0"]) {
        
            
            _titleLabel=[[UILabel alloc] initWithFrame:CGRectMake(20, 0, 70, self.contentView.height)];
            
            _titleLabel.font=[UIFont systemFontOfSize:14];
            
            [self.contentView addSubview:_titleLabel];
            
            _cellTextField=[[UITextField alloc] initWithFrame:CGRectMake(_titleLabel.right, 0, self.contentView.width-_titleLabel.right-20, self.contentView.height)];
            
                _cellTextField.borderStyle=UITextBorderStyleNone;
            
             _cellTextField.keyboardType=UIKeyboardTypeEmailAddress;
            
                _cellTextField.font=[UIFont systemFontOfSize:14];

            
            [self.contentView addSubview:_cellTextField];
            
            
            
            
        }
        
        
        if ([reuseIdentifier isEqualToString:@"cell1"]) {
            
            
            _titleLabel=[[UILabel alloc] initWithFrame:CGRectMake(20, 0, 70, self.contentView.height)];
            
            _titleLabel.font=[UIFont systemFontOfSize:14];
            
            [self.contentView addSubview:_titleLabel];
            
            
            _sendCodeButton=[UIButton buttonWithType:UIButtonTypeCustom];
            
            _sendCodeButton.frame=CGRectMake(0, 7.5, 90, 30);
            
            _sendCodeButton.right=SCREEN_WIDTH-20;
            
            _sendCodeButton.layer.cornerRadius=3;
            
            _sendCodeButton.clipsToBounds=YES;
            
            [_sendCodeButton setTitle:@"获取验证码" forState:0];
            
            
             _cellTextField.keyboardType=UIKeyboardTypeNumberPad;
            
            _sendCodeButton.layer.borderWidth=1;
            
            _sendCodeButton.layer.borderColor=kColor_AppNavColor.CGColor;
            
           
            
            
            
            _sendCodeButton.titleLabel.font=[UIFont systemFontOfSize:12];
            
            [_sendCodeButton setTitleColor:kColor_AppNavColor forState:0];
            
            [self.contentView addSubview:_sendCodeButton];
            
            
            
            [_sendCodeButton addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
            
            
            _cellTextField=[[UITextField alloc] initWithFrame:CGRectMake(_titleLabel.right, 0, self.contentView.width-_titleLabel.right-20-_sendCodeButton.width, self.contentView.height)];
            
            _cellTextField.font=[UIFont systemFontOfSize:14];
            
            
            [self.contentView addSubview:_cellTextField];
            

            
            
            
        }
        
        
        
        if ([reuseIdentifier isEqualToString:@"cell2"]) {
            
            
            _titleLabel=[[UILabel alloc] initWithFrame:CGRectMake(20, 0, 70, self.contentView.height)];
            
            _titleLabel.font=[UIFont systemFontOfSize:14];
            
            [self.contentView addSubview:_titleLabel];
            
            
            _phoneLabel=[[UILabel alloc] initWithFrame:CGRectMake(_titleLabel.right, 0, self.contentView.width-_titleLabel.right-20, self.contentView.height)];
            
           
            
            _phoneLabel.font=[UIFont systemFontOfSize:14];
            
            
            [self.contentView addSubview:_phoneLabel];

            
            
            
            
        }

        
        
    }
    
    
    return self;
    
    
}


-(void)buttonClick:(UIButton*)button{
    if (_sendCodeButtonClickBlock) {
        
        _sendCodeButtonClickBlock(button);
        
        
    }
    
    
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
